#!/usr/bin/envpython
# -*-coding:UTF-8-*-
'''
@File    :   menu_batchdelete.py
@Contact :   308711822@qq.com
@License :   (C) Copyright 2021-2225, Personal exclusive right.

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/5/27 17:27   小钟同学      1.0         None
'''
import json

from infirmary_admin_src.infirmary_common.infirmary_controller import IBaseController
from infirmary_admin_src.infirmary_common.infirmary_controller.rest_controller_with_depends import \
    RestControllerWithDepends
from fastapi import Request, Depends, Path

from infirmary_admin_src.infirmary_smart_admin.infirmary_biz.infirmary.businesses.schemas import SchemaBase
from infirmary_admin_src.infirmary_smart_admin.infirmary_biz.system.login.services import LogicBusinesses



class XParam(SchemaBase):
    '''
    账号密码登录参数
    '''
    menuIdList: str


class IController(IBaseController):
    '''
    定制相关约束检测函数逻辑步序
    '''

    def __init__(self, *, request: Request,
                 schema_param: XParam = Depends(),
                 ):
        super().__init__(request=request)
        # 入参参数
        # 入参参数
        self.schema_param = schema_param





@RestControllerWithDepends()
class SystemMenuBatchdeleteController(IController):

    def business_login(self):
        pass
        result = LogicBusinesses.edit_sys_menu_batch(ids=self.schema_param.menuIdList.split(','),deleted_flag=1)
        if result:
            self.response_msg='删除成功'
        else:
            self.response_ok=False
            self.response_msg = '删除失败'
            return None
